package com.ibsol.controller
{
	import com.ibsol.event.FilterEvent;
	import com.ibsol.locator.ModelLocator;
	import com.iizer.dispatcher.SystemDispatcher;
	
	public class FilterController
	{
		[Bindable]
		private var modelLocator:ModelLocator = ModelLocator.getInstance(); 
		private var systemDispatcher:SystemDispatcher = SystemDispatcher.getInstance(); 
			
		public function FilterController()
		{
			systemDispatcher.addEventListener(FilterEvent.ADD_FILTER,onAddFilter);
		}
		
		private function onAddFilter(ev:FilterEvent):void
		{
			modelLocator.packageFilter.setFilter(ev.filterName,ev.filterFunction);
		}

	}
}